package com.novax.ex.activity.open.api;

import com.novax.ex.activity.open.model.request.ActivityRequest;
import com.novax.ex.activity.open.model.response.IeoInfoResponse;
import com.novax.ex.activity.open.model.response.IeoResponse;
import com.novax.ex.common.results.ReturnResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Description: IEO-活动信息
 *
 * @author shaw
 * @date 11/30/22 10:46
 */
@Tag(name = "IEO-前台展示-活动", description = "IEO-活动信息")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "IeoApi", contextId = "IeoApi")
@RequestMapping("/v3/public/ieos")
public interface IeoApi {

    @Operation(summary = "查询所有活动")
    @GetMapping
    ReturnResult<List<IeoResponse>> items(
            @RequestHeader("language") String language,
            @ParameterObject ActivityRequest activityRequest);

    @Operation(summary = "活动详情")
    @GetMapping(value = "/{id}")
    ReturnResult<IeoInfoResponse> detail(
            @RequestHeader(value = "token", required=false) String token,
            @RequestHeader("language") String language,
            @PathVariable Long id);
}
